<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
</head>

<body>
    <script>
        // 第一题
        var n = 1;
        function f1() {
            console.log(n); // n=1
        }
        function f2() {
            console.log(n); //  n=2
            n = 2;
            f1();
            console.log(n); // n=2
        }
        f2();

    </script>
</body>

</html>